freecivfandomcom-20200223-history
Server Manual 1.8.0
Overview The Freeciv server is the core of the Freeciv system. It maintains the complete states of all game variables (map, units, cities, research, etc.), updates them based on player client requests, and sends updates to the clients. For multiplayer games it is the central arbiter of the game's progress. For solitaire play, it implements the Artificial Intelligence (AI) races. Whether for solitaire or multiplayer games, the server operator runs the server in a window. The operator may set game options, including loading entirely new sets of game rules, or load prepackaged scenarios. Players use client programs to connect to the server via the network (even solitaire games, run on one computer, use the network software to connect the client and server programs). Once all players have connected, the server operator starts the game, and players then proceed with play. In the course of a typical game, server operators will monitor progress, using mechanisms inside the game ("chat") or outside the game (E-mail) to communicate with players. The operator may also play, running a client program in another process. As the game progresses, the operator may use server commands to adjust game options, save the game for later restart, or terminate the game. The Freeciv Metaserver is a server on the Internet which provides a coordination point for Freeciv multiplayer games. If enabled by the operator by command line option --meta, the server informs the Metaserver of the status and progress of the game. This one-way information flow (server to Metaserver) should, in time, allow players to locate servers and games to play on. This document reflects the Freeciv server program for the 1.8.0 build. The general concepts involved will also help in using Freeciv 1.7.2 and earlier versions. Usage On a Unix system, you will need to start the server in a window (e.g., xterm, virtual console), since commands must be entered during play. Run the server with the command "civserver" followed by your desired command line options (described later). (If you do not have Freeciv installed with "make install", use the "ser" script provided in the distribution.) The server will initialize and prompt for input. At this point, you will wish to set game options, minor ones (timeout times), medium ones (map size), and major ones (rules for Civilization I or II). For the game options, see Command Line Options and Files and Environment below. If you have a collection of option settings which you use often, you may enter them into a flat ASCII file and read them into the server quickly with the -r option. You should coordinate your option choices with the players to reduce confusion. You may also load entire scenarios with the -f command line option. While you are entering commands, the server will have announced the game to the Freeciv Metaserver (if you enabled it), and will have enabled client network connections. Player client programs will connect to the server and wait; you can use the "list" command to show the connected players. Once all settings have been made, and all desired players have connected, you start the game with the "start" command. Once the game is started, each player will be asked to select a race. After these selections, the server will assign AI races, generate the map, send all initial data to the clients, and the game is on. In Civilization I and II, each race's turn proceeds in sequence: first the human player moves, and presses Next Turn; then the Romans move, then the Greeks, and so on through a standard list of AI races, ending with the Barbarians, after which the human player gets control again. In Freeciv multiplayer, all of the players enter orders simultaneously. The server processes all orders from clients in the order in which they are received. Some things, however, only update at the end of a "turn": Cities grow and eat food, research happens, revolutions complete, units heal damage, and the calendar turns to a new year. That end-of-turn update takes place when all human players have indicated Next Turn (but see the Timeout option setting). If a player takes several minutes to finish moves, all players wait until that last one completes before the update takes place. If there are AI races, they make their moves at the start of the turn update. Once the victory conditions have been met (see README in the distribution), the game ends. But you may suspend the game at any time, and resume it another day if you wish. The "save" command will write out all game state into a file as of the instant of the command (even with players entering orders). Then you may quit the server. When you wish to resume (and have coordinated the restart of the game with the players), run the server again with the -f option to read in the save file. That will reset the internal data to reflect the state in the file, and leave the game paused. Once the player clients reconnect, an "start" command will get the game moving again. In addition, if the server or the system fails, you may be able to fall back to the list automatic save done every few turns (set by option setting saveturns); its files are the same. Command Line Options The following options are accepted on the command line of the server. They may not be combined; that is, "civserver -fp savegame.sav 555" will not work, instead you would need to enter "civserver -f savegame.sav -p 555". Most options have a short form (single hyphen and single letter) and a long form (double hyphen and a complete word); their effects are identical. ;-f filename or --file filename :Loads a saved game into the server before initialization, instead of starting a new game. This is for reloading saved games, or for loading scenarios. The distribution comes with three such scenarios, typically stored in /usr/local/share/freeciv: :;earth-160x90.sav ::the real Earth at 160x90 size. :;earth-80x50.sav ::the real Earth at 80x50 size. :;europe.sav ::the real Europe at 200x100 size. ;-h or --help :Prints out a description of the command line options and exits. ;-l filename or --log filename :Defines a log file to be produced during processing. By default, "fatal" and "normal" messages are printed to standard output. With a log file, such messages go to the log instead. Use the -d option to set how much is logged. ;-g filename or --gamelog filename :Defines a log file to be produced during processing. This is a game progress log, of game-related events recording the activities of the players. ;-m or --meta :Directs the server to communicate with the Freeciv Metaserver. ;-p number or --port number :Specifies the TCP port number to which clients will connect; players must know this number to be able to connect if they are not to use the default of 5555 decimal. You may need to use this if 5555 is not available for your use on your system. ;-r filename or --read filename :Specifies a file of server commands which the server will automatically read and process, as if you had typed them in at the server's prompt. The distribution has an example that sets options to be similar to Civilization I, which the option -r /usr/local/share/freeciv/civ1.serv would read. ;-s name or --server name :Specifies the name to be given to the Freeciv Metaserver as the name of this server. This is distinct from the description line set by the "meta" command; both are displayed in the Metaserver's output. ;-d number or --debug number :Sets the amount of debugging information to be logged in the file named by the -l option. The number should be 0 for fatal errors only, 1 for fatal and normal messages, or 2 for fatal, normal, and debugging messages. ;-v or --version :Causes the server to display its version number and exit. Commands (updated for version 1.12 CVS of 18/02/02) You may enter commands into the server at any time, either before or during the running of a game. Command names are case-sensitive, as are filename and setting; argument playername generally is not. In all cases where a playername is expected as a command argument, it is the name of the ruler of a race in the same; e.g., you probably want to refer to "caesar" rather than "romans." ;start :Starts the game. ;help (option-name) :Displays more information about the server commands and options, if you add the option-name, it gives help about that option. ;list :Lists the playsers in the game. ;quit :quit the game and shut the server down. ;cut playername :Cut playername's connection to the game. ;explain option-name :Gives help information to a specific command; synonym for help option-name. ;show (option-name) :Without argument, it gives a list of all server options and their values, with an argument it returns the value of the option option-name. ;score :Displays the current score. ;wall message :Sends message to all connected players. ;set option-name value :Set the value of the server option option-name to value. ;metaconnection (? or up or down) :With the argument ?, this command gives the status of the connection with the metaserver; up brings the connection with the server up while down brings it down. ;metaserver weblocation-of-metaserver :sets the location of the metaserver on the WWW to weblocation-of-metaserver (must include http://!). ;aitoggle playername :Toggle the status of the AI of playername. ;create playername :Create an AI with the name playername (the race is detirmined by the race playername can be ruler of according to the nationset). ;easy (playername) :Sets the AI to 'easy' at player playername, when no playername is given, all AI-players are set to easy. ;normal (playername) :Sets the AI to 'normal' at player playername, when no playername is given, all AI-players are set to easy. ;hard (playername) :Sets the AI to 'hard' at player playername, when no playername is given, all AI-players are set to easy. ;cmdlevel (arguments) :Sets the commandlevel of (a) target player(s). With these levels you can set the degree of the options a player can set. All of the commands/options require a certain level to execute them. See the sourcecode for more info. ;firstlevel :Shows the level a player will get when he connects to the game. ;endgame :Ends the game immediately. ;remove playername :Completely remove playername from the game, including cities, units, etc. ;save (filename) :Saves the current game to filename. If no filename has been specified, the file is saved in the format >auto-save prefix<>year